package com.powernode;

import com.powernode.spring6.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author JiangZhaoFeng
 * @Date 2025/8/6 11:14
 * @Description:
 */
public class AutowireByName {

    @Test
    public void testAutowireByName(){
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-autowire.xml");
        UserService userService = context.getBean("userService",UserService.class);
        userService.save();
    }
}
